package com.aaa.qy127.controller;

import com.aaa.qy127.entity.Type;
import com.aaa.qy127.service.TypeService;
import com.aaa.qy127.util.Result;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;
import java.util.Map;


@RequestMapping("/type")
@RestController
public class TypeController {

    @Resource(name = "typeServiceImpl")
    private TypeService typeService;

    /**
     * 查询 所有的书籍类型
     * @return
     */
    @RequestMapping("/selectType")
    public  List<Map<String, Object>> selectType(){
        List<Map<String, Object>> maps = typeService.selType();
        return maps;
    }

    @RequestMapping("/queryAllType")
    public Result queryAllType(Type types){
        return  typeService.queryAllType(types);
    }
    @RequestMapping("/insertAndUpdate")
    public Map<String, Object> insertAndUpdate(Type types){
        return typeService.insertAndUpdate(types);
    }
    @RequestMapping("/delType")
    public Map<String, Object> delType(Type types){
        return typeService.delType(types);
    }
}
